#include "common_inc.h"
#include "configurations.h"
#include "can.h"
#include "bsp_can.h"
#include "bsp_uart.h"
#define debugPrintf(str, ...) //UARTx_Printf(&huart1, str, __VA_ARGS__)

extern Motor motor;
extern EncoderCalibrator encoderCalibrator;


void OnCanCmd(uint8_t id, uint8_t _cmd, uint8_t* _data, uint32_t _len)
{
    if (id == 0 || id == boardConfig.canNodeId)
    {
        interface_base(&hcan, _cmd, _data);
    }
    else
    {
        // 转发Can消息到串口
        uart1_send_pack(id, _cmd, _data, _len);
    }
}

